{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Importing PulP solver\n",
    "from pulp import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Demand points\n",
    "demand_points=['Port of King Abdul Aziz','Port of Mersin','Port of Jebel Ali']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of King Abdul Aziz', 'Port of Mersin', 'Port of Jebel Ali']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "demand_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Supply Points\n",
    "supply_points=['Port of Shanghai','Port of Marseille','Port of Hamburg_Germany','Port of Budapest','Port of Jawaharlal Nehru','Port of Nagoya','Port of Busan','Port of Manzanillo','Port of Kaohsiung','Port of Mersin','Port of Immingham','Port of New York','Port of Los Angeles']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of Shanghai',\n",
       " 'Port of Marseille',\n",
       " 'Port of Hamburg_Germany',\n",
       " 'Port of Budapest',\n",
       " 'Port of Jawaharlal Nehru',\n",
       " 'Port of Nagoya',\n",
       " 'Port of Busan',\n",
       " 'Port of Manzanillo',\n",
       " 'Port of Kaohsiung',\n",
       " 'Port of Mersin',\n",
       " 'Port of Immingham',\n",
       " 'Port of New York',\n",
       " 'Port of Los Angeles']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "supply_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the distances\n",
    "distance = dict(zip(supply_points,[dict(zip(demand_points, [6922,8546,6627])),\n",
    "dict(zip(demand_points, [5388,1806,5080])),\n",
    "dict(zip(demand_points, [7615,4032,7306])),\n",
    "dict(zip(demand_points, [5669,2028,5360])),\n",
    "dict(zip(demand_points, [1630,3720,1335])),\n",
    "dict(zip(demand_points, [7800,9424,7505])),\n",
    "dict(zip(demand_points, [7438,9062,7143])),\n",
    "dict(zip(demand_points, [13099,9516,12790])),\n",
    "dict(zip(demand_points, [6356,7981,6063])),\n",
    "dict(zip(demand_points, [3885,0,3576])),\n",
    "dict(zip(demand_points, [7388,3804,7080])),\n",
    "dict(zip(demand_points, [9222,5617,8918])),\n",
    "dict(zip(demand_points, [11344,11024,11116]))]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Shanghai': {'Port of King Abdul Aziz': 6922,\n",
       "  'Port of Mersin': 8546,\n",
       "  'Port of Jebel Ali': 6627},\n",
       " 'Port of Marseille': {'Port of King Abdul Aziz': 5388,\n",
       "  'Port of Mersin': 1806,\n",
       "  'Port of Jebel Ali': 5080},\n",
       " 'Port of Hamburg_Germany': {'Port of King Abdul Aziz': 7615,\n",
       "  'Port of Mersin': 4032,\n",
       "  'Port of Jebel Ali': 7306},\n",
       " 'Port of Budapest': {'Port of King Abdul Aziz': 5669,\n",
       "  'Port of Mersin': 2028,\n",
       "  'Port of Jebel Ali': 5360},\n",
       " 'Port of Jawaharlal Nehru': {'Port of King Abdul Aziz': 1630,\n",
       "  'Port of Mersin': 3720,\n",
       "  'Port of Jebel Ali': 1335},\n",
       " 'Port of Nagoya': {'Port of King Abdul Aziz': 7800,\n",
       "  'Port of Mersin': 9424,\n",
       "  'Port of Jebel Ali': 7505},\n",
       " 'Port of Busan': {'Port of King Abdul Aziz': 7438,\n",
       "  'Port of Mersin': 9062,\n",
       "  'Port of Jebel Ali': 7143},\n",
       " 'Port of Manzanillo': {'Port of King Abdul Aziz': 13099,\n",
       "  'Port of Mersin': 9516,\n",
       "  'Port of Jebel Ali': 12790},\n",
       " 'Port of Kaohsiung': {'Port of King Abdul Aziz': 6356,\n",
       "  'Port of Mersin': 7981,\n",
       "  'Port of Jebel Ali': 6063},\n",
       " 'Port of Mersin': {'Port of King Abdul Aziz': 3885,\n",
       "  'Port of Mersin': 0,\n",
       "  'Port of Jebel Ali': 3576},\n",
       " 'Port of Immingham': {'Port of King Abdul Aziz': 7388,\n",
       "  'Port of Mersin': 3804,\n",
       "  'Port of Jebel Ali': 7080},\n",
       " 'Port of New York': {'Port of King Abdul Aziz': 9222,\n",
       "  'Port of Mersin': 5617,\n",
       "  'Port of Jebel Ali': 8918},\n",
       " 'Port of Los Angeles': {'Port of King Abdul Aziz': 11344,\n",
       "  'Port of Mersin': 11024,\n",
       "  'Port of Jebel Ali': 11116}}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "distance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Fiber Demand\n",
    "Fiber_demand=dict(zip(demand_points, [9128249.094,7916745.706,8666748.328]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of King Abdul Aziz': 9128249.094,\n",
       " 'Port of Mersin': 7916745.706,\n",
       " 'Port of Jebel Ali': 8666748.328}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Fiber_demand"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Fiber Supply\n",
    "Fiber_supply=dict(zip(supply_points, [7891206.716800,4720787.525080,3013639.269080,1741988.017000,1532949.455000,1498109.694000,1289071.132000,1080032.570000,1010353.050000,870994.008400,627115.686000,256623.912100,178873.092100])) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Shanghai': 7891206.7168,\n",
       " 'Port of Marseille': 4720787.52508,\n",
       " 'Port of Hamburg_Germany': 3013639.26908,\n",
       " 'Port of Budapest': 1741988.017,\n",
       " 'Port of Jawaharlal Nehru': 1532949.455,\n",
       " 'Port of Nagoya': 1498109.694,\n",
       " 'Port of Busan': 1289071.132,\n",
       " 'Port of Manzanillo': 1080032.57,\n",
       " 'Port of Kaohsiung': 1010353.05,\n",
       " 'Port of Mersin': 870994.0084,\n",
       " 'Port of Immingham': 627115.686,\n",
       " 'Port of New York': 256623.9121,\n",
       " 'Port of Los Angeles': 178873.0921}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Fiber_supply"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "prob = LpProblem(\"Transportation\", LpMinimize)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "None\n",
       "VARIABLES"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "routes = [(i,j) for i in supply_points for j in demand_points]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('Port of Shanghai', 'Port of King Abdul Aziz'),\n",
       " ('Port of Shanghai', 'Port of Mersin'),\n",
       " ('Port of Shanghai', 'Port of Jebel Ali'),\n",
       " ('Port of Marseille', 'Port of King Abdul Aziz'),\n",
       " ('Port of Marseille', 'Port of Mersin'),\n",
       " ('Port of Marseille', 'Port of Jebel Ali'),\n",
       " ('Port of Hamburg_Germany', 'Port of King Abdul Aziz'),\n",
       " ('Port of Hamburg_Germany', 'Port of Mersin'),\n",
       " ('Port of Hamburg_Germany', 'Port of Jebel Ali'),\n",
       " ('Port of Budapest', 'Port of King Abdul Aziz'),\n",
       " ('Port of Budapest', 'Port of Mersin'),\n",
       " ('Port of Budapest', 'Port of Jebel Ali'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of King Abdul Aziz'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of Mersin'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of Jebel Ali'),\n",
       " ('Port of Nagoya', 'Port of King Abdul Aziz'),\n",
       " ('Port of Nagoya', 'Port of Mersin'),\n",
       " ('Port of Nagoya', 'Port of Jebel Ali'),\n",
       " ('Port of Busan', 'Port of King Abdul Aziz'),\n",
       " ('Port of Busan', 'Port of Mersin'),\n",
       " ('Port of Busan', 'Port of Jebel Ali'),\n",
       " ('Port of Manzanillo', 'Port of King Abdul Aziz'),\n",
       " ('Port of Manzanillo', 'Port of Mersin'),\n",
       " ('Port of Manzanillo', 'Port of Jebel Ali'),\n",
       " ('Port of Kaohsiung', 'Port of King Abdul Aziz'),\n",
       " ('Port of Kaohsiung', 'Port of Mersin'),\n",
       " ('Port of Kaohsiung', 'Port of Jebel Ali'),\n",
       " ('Port of Mersin', 'Port of King Abdul Aziz'),\n",
       " ('Port of Mersin', 'Port of Mersin'),\n",
       " ('Port of Mersin', 'Port of Jebel Ali'),\n",
       " ('Port of Immingham', 'Port of King Abdul Aziz'),\n",
       " ('Port of Immingham', 'Port of Mersin'),\n",
       " ('Port of Immingham', 'Port of Jebel Ali'),\n",
       " ('Port of New York', 'Port of King Abdul Aziz'),\n",
       " ('Port of New York', 'Port of Mersin'),\n",
       " ('Port of New York', 'Port of Jebel Ali'),\n",
       " ('Port of Los Angeles', 'Port of King Abdul Aziz'),\n",
       " ('Port of Los Angeles', 'Port of Mersin'),\n",
       " ('Port of Los Angeles', 'Port of Jebel Ali')]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "routes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Decision Variables\n",
    "X = LpVariable.dicts(\"ShipmentAmount\",(supply_points, demand_points),0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Shanghai': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Shanghai_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali},\n",
       " 'Port of Marseille': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Marseille_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali},\n",
       " 'Port of Hamburg_Germany': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Hamburg_Germany_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Jebel_Ali},\n",
       " 'Port of Budapest': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Budapest_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Budapest_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Budapest_Port_of_Jebel_Ali},\n",
       " 'Port of Jawaharlal Nehru': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali},\n",
       " 'Port of Nagoya': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Nagoya_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Nagoya_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Nagoya_Port_of_Jebel_Ali},\n",
       " 'Port of Busan': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Busan_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali},\n",
       " 'Port of Manzanillo': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali},\n",
       " 'Port of Kaohsiung': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Kaohsiung_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Kaohsiung_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Kaohsiung_Port_of_Jebel_Ali},\n",
       " 'Port of Mersin': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Mersin_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali},\n",
       " 'Port of Immingham': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Immingham_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Immingham_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Immingham_Port_of_Jebel_Ali},\n",
       " 'Port of New York': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_New_York_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali},\n",
       " 'Port of Los Angeles': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali}}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Objective Function\n",
    "prob += sum(X[i][j]*distance[i][j] for (i,j) in routes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "5360*ShipmentAmount_Port_of_Budapest_Port_of_Jebel_Ali + 5669*ShipmentAmount_Port_of_Budapest_Port_of_King_Abdul_Aziz + 2028*ShipmentAmount_Port_of_Budapest_Port_of_Mersin + 7143*ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali + 7438*ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz + 9062*ShipmentAmount_Port_of_Busan_Port_of_Mersin + 7306*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Jebel_Ali + 7615*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_King_Abdul_Aziz + 4032*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Mersin + 7080*ShipmentAmount_Port_of_Immingham_Port_of_Jebel_Ali + 7388*ShipmentAmount_Port_of_Immingham_Port_of_King_Abdul_Aziz + 3804*ShipmentAmount_Port_of_Immingham_Port_of_Mersin + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1630*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz + 3720*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin + 6063*ShipmentAmount_Port_of_Kaohsiung_Port_of_Jebel_Ali + 6356*ShipmentAmount_Port_of_Kaohsiung_Port_of_King_Abdul_Aziz + 7981*ShipmentAmount_Port_of_Kaohsiung_Port_of_Mersin + 11116*ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali + 11344*ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz + 11024*ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 13099*ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz + 9516*ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin + 5080*ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali + 5388*ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz + 1806*ShipmentAmount_Port_of_Marseille_Port_of_Mersin + 3576*ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali + 3885*ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz + 7505*ShipmentAmount_Port_of_Nagoya_Port_of_Jebel_Ali + 7800*ShipmentAmount_Port_of_Nagoya_Port_of_King_Abdul_Aziz + 9424*ShipmentAmount_Port_of_Nagoya_Port_of_Mersin + 8918*ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali + 9222*ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz + 5617*ShipmentAmount_Port_of_New_York_Port_of_Mersin + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 8546*ShipmentAmount_Port_of_Shanghai_Port_of_Mersin + 0\n",
       "VARIABLES\n",
       "ShipmentAmount_Port_of_Budapest_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Budapest_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Budapest_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Kaohsiung_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Kaohsiung_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Kaohsiung_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Mersin Continuous"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "5360*ShipmentAmount_Port_of_Budapest_Port_of_Jebel_Ali + 5669*ShipmentAmount_Port_of_Budapest_Port_of_King_Abdul_Aziz + 2028*ShipmentAmount_Port_of_Budapest_Port_of_Mersin + 7143*ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali + 7438*ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz + 9062*ShipmentAmount_Port_of_Busan_Port_of_Mersin + 7306*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Jebel_Ali + 7615*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_King_Abdul_Aziz + 4032*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Mersin + 7080*ShipmentAmount_Port_of_Immingham_Port_of_Jebel_Ali + 7388*ShipmentAmount_Port_of_Immingham_Port_of_King_Abdul_Aziz + 3804*ShipmentAmount_Port_of_Immingham_Port_of_Mersin + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1630*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz + 3720*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin + 6063*ShipmentAmount_Port_of_Kaohsiung_Port_of_Jebel_Ali + 6356*ShipmentAmount_Port_of_Kaohsiung_Port_of_King_Abdul_Aziz + 7981*ShipmentAmount_Port_of_Kaohsiung_Port_of_Mersin + 11116*ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali + 11344*ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz + 11024*ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 13099*ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz + 9516*ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin + 5080*ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali + 5388*ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz + 1806*ShipmentAmount_Port_of_Marseille_Port_of_Mersin + 3576*ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali + 3885*ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz + 7505*ShipmentAmount_Port_of_Nagoya_Port_of_Jebel_Ali + 7800*ShipmentAmount_Port_of_Nagoya_Port_of_King_Abdul_Aziz + 9424*ShipmentAmount_Port_of_Nagoya_Port_of_Mersin + 8918*ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali + 9222*ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz + 5617*ShipmentAmount_Port_of_New_York_Port_of_Mersin + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 8546*ShipmentAmount_Port_of_Shanghai_Port_of_Mersin + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Port_of_Budapest_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Immingham_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Kaohsiung_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Nagoya_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz >= 9128249.094\n",
       "\n",
       "_C2: ShipmentAmount_Port_of_Budapest_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Immingham_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Kaohsiung_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Nagoya_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Mersin >= 7916745.706\n",
       "\n",
       "_C3: ShipmentAmount_Port_of_Budapest_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Immingham_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Kaohsiung_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Nagoya_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali >= 8666748.328\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Port_of_Budapest_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Budapest_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Budapest_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Kaohsiung_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Kaohsiung_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Kaohsiung_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Mersin Continuous"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for j in demand_points:\n",
    "    prob += sum(X[i][j] for i in supply_points) >= Fiber_demand[j]\n",
    "    \n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "5360*ShipmentAmount_Port_of_Budapest_Port_of_Jebel_Ali + 5669*ShipmentAmount_Port_of_Budapest_Port_of_King_Abdul_Aziz + 2028*ShipmentAmount_Port_of_Budapest_Port_of_Mersin + 7143*ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali + 7438*ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz + 9062*ShipmentAmount_Port_of_Busan_Port_of_Mersin + 7306*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Jebel_Ali + 7615*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_King_Abdul_Aziz + 4032*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Mersin + 7080*ShipmentAmount_Port_of_Immingham_Port_of_Jebel_Ali + 7388*ShipmentAmount_Port_of_Immingham_Port_of_King_Abdul_Aziz + 3804*ShipmentAmount_Port_of_Immingham_Port_of_Mersin + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1630*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz + 3720*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin + 6063*ShipmentAmount_Port_of_Kaohsiung_Port_of_Jebel_Ali + 6356*ShipmentAmount_Port_of_Kaohsiung_Port_of_King_Abdul_Aziz + 7981*ShipmentAmount_Port_of_Kaohsiung_Port_of_Mersin + 11116*ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali + 11344*ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz + 11024*ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 13099*ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz + 9516*ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin + 5080*ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali + 5388*ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz + 1806*ShipmentAmount_Port_of_Marseille_Port_of_Mersin + 3576*ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali + 3885*ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz + 7505*ShipmentAmount_Port_of_Nagoya_Port_of_Jebel_Ali + 7800*ShipmentAmount_Port_of_Nagoya_Port_of_King_Abdul_Aziz + 9424*ShipmentAmount_Port_of_Nagoya_Port_of_Mersin + 8918*ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali + 9222*ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz + 5617*ShipmentAmount_Port_of_New_York_Port_of_Mersin + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 8546*ShipmentAmount_Port_of_Shanghai_Port_of_Mersin + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Port_of_Budapest_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Immingham_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Kaohsiung_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Nagoya_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz >= 9128249.094\n",
       "\n",
       "_C2: ShipmentAmount_Port_of_Budapest_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Immingham_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Kaohsiung_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Nagoya_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Mersin >= 7916745.706\n",
       "\n",
       "_C3: ShipmentAmount_Port_of_Budapest_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Immingham_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Kaohsiung_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Nagoya_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali >= 8666748.328\n",
       "\n",
       "_C4: ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Mersin = 7891206.7168\n",
       "\n",
       "_C5: ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Mersin = 4720787.52508\n",
       "\n",
       "_C6: ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Mersin = 3013639.26908\n",
       "\n",
       "_C7: ShipmentAmount_Port_of_Budapest_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Budapest_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Budapest_Port_of_Mersin = 1741988.017\n",
       "\n",
       "_C8: ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin = 1532949.455\n",
       "\n",
       "_C9: ShipmentAmount_Port_of_Nagoya_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Nagoya_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Nagoya_Port_of_Mersin = 1498109.694\n",
       "\n",
       "_C10: ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Mersin = 1289071.132\n",
       "\n",
       "_C11: ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin = 1080032.57\n",
       "\n",
       "_C12: ShipmentAmount_Port_of_Kaohsiung_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Kaohsiung_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Kaohsiung_Port_of_Mersin = 1010353.05\n",
       "\n",
       "_C13: ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Mersin = 870994.0084\n",
       "\n",
       "_C14: ShipmentAmount_Port_of_Immingham_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Immingham_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Immingham_Port_of_Mersin = 627115.686\n",
       "\n",
       "_C15: ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Mersin = 256623.9121\n",
       "\n",
       "_C16: ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin = 178873.0921\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Port_of_Budapest_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Budapest_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Budapest_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Kaohsiung_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Kaohsiung_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Kaohsiung_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Mersin Continuous"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for i in supply_points:\n",
    "    prob += sum(X[i][j] for j in demand_points) == Fiber_supply[i]\n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Status: Optimal\n",
      "ShipmentAmount_Port_of_Budapest_Port_of_Mersin = 1741988.0\n",
      "ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali = 1289071.1\n",
      "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Jebel_Ali = 3013639.3\n",
      "ShipmentAmount_Port_of_Immingham_Port_of_Mersin = 627115.69\n",
      "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz = 1532949.5\n",
      "ShipmentAmount_Port_of_Kaohsiung_Port_of_King_Abdul_Aziz = 1010353.0\n",
      "ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz = 178873.09\n",
      "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali = 1080032.6\n",
      "ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali = 300762.44\n",
      "ShipmentAmount_Port_of_Marseille_Port_of_Mersin = 4420025.1\n",
      "ShipmentAmount_Port_of_Mersin_Port_of_Mersin = 870994.01\n",
      "ShipmentAmount_Port_of_Nagoya_Port_of_Jebel_Ali = 1498109.7\n",
      "ShipmentAmount_Port_of_New_York_Port_of_Mersin = 256623.91\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali = 1485133.2\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz = 6406073.5\n",
      "Total kilogram_miles = 138287074791.99\n"
     ]
    }
   ],
   "source": [
    "prob.solve()\n",
    "\n",
    "print(\"Status:\", LpStatus[prob.status])\n",
    "\n",
    "for v in prob.variables():\n",
    "    if v.varValue > 0:\n",
    "        print(v.name, \"=\", v.varValue)\n",
    "\n",
    "print(\"Total kilogram_miles =\", value(prob.objective))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
